import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

let defaultCity = '北京';
defaultCity = localStorage.city;
//
const state = {
  city:defaultCity
  // city:'上海'
}
const mutations = {
  changeCity(state,cityName){
    state.city=cityName;
    localStorage.city = cityName;
  }
}

export default new Vuex.Store({
  state,
  mutations

})
